#define COMDBG 1
/*
/mob/proc/Hit(var/mob/M)

	var/shit
	if(M.wielded)
		shit = M.wielded.meleebonus
	else
		shit = 1

	if (rand(0, 20) > src.rfx || COMDBG) // If the dice roll succeeds (roll against reflexes)
		M.Hurt(str * shit, "h", 0)

		if (COMDBG)
			world << "Ow! I was hurt in the head! [head_h]"
*/
/mob/var
	dmg = 10
	bonus = 1
	aim = "t"
	attacktype = 0
	basedmg = 5
	basebonus = 1
	batype = 0
	ranged = 1

mob/verb/Aim()

	var/i = input("GOATS!")in list("Head","Torso","Right Arm","Left Arm","Groin","Left leg", "Right Leg")

	if(i == "Head")
		aim = "h"
	if(i == "Torso")
		aim = "t"
	if(i == "Right Arm")
		aim = "ra"
	if(i == "Left Arm")
		aim = "la"
	if(i == "Groin")
		aim = "g"
	if(i == "Left Leg")
		aim = "ll"
	if(i == "Right Leg")
		aim = "rl"



mob/verb/wield(obj/item/O in usr.contents)
	usr << "You wield the [O.name]."
	dmg = O.idmg
	bonus = O.ibonus
	attacktype = O.iatype


mob/verb/unwield()
	usr << "You unwield the WIELDED_NAME"
	dmg = basedmg
	bonus = basebonus
	attacktype = batype


/mob/proc/Attack(var/mob/M)

	var/X

	//usr << M.name



	if((M.loc == loc && M.key != key)||(ranged))// If in same loc

		X = roll("1d6")
		//usr << X
		if(X > M.hitchance)
			M.Hurt(dmg * bonus, aim, attacktype)
			view(3) << "[M.name] was hit for [dmg * bonus]"
		else
			view(3) << "[name] misses [M.name]"
	else
		usr << "Too far away for a melee attack!"
	//world << "[M.head_h]"


mob/Click()
	if(src in oview(usr, 1))
		usr.Attack(src)
	..()



/*
mob/proc/FindWieldedWeapon() // returns wielded weapons base attack value

	var/obj/item/W
	var/BAV as num
	for (W in src)

		if(W.wielded)
			BAV = W.baseattackvalue
			*/

